import DashView from './components/Dash.vue'
import LoginView from './components/Login.vue'
import NotFoundView from './components/404.vue'

// Import Views - Dash
import DashboardView from './components/views/Dashboard.vue'
import TablesView from './components/views/Tables.vue'
import TasksView from './components/views/Tasks.vue'
import SettingView from './components/views/Setting.vue'
import AccessView from './components/views/Access.vue'
import ServerView from './components/views/Server.vue'
import ReposView from './components/views/Repos.vue'
import UsersView from './components/views/Users.vue'
import UserImportView from './components/views/UserImport.vue'
import organizationView from './components/views/Organization.vue'
import OnJobUsers from './components/views/OnJobUsers.vue'
import accountMgr from './components/views/accountMgr.vue'
import roleMgr from './components/views/roleMgr.vue'
import funcPrivMgr from './components/views/funcPrivMgr.vue'
import dataPrivMgr from './components/views/dataPrivMgr.vue'
import reportPrivMgr from './components/views/reportPrivMgr.vue'
import employeeBaseInfo from './components/views/employees/employeeBaseInfo.vue'
import extraInfoView from './components/views/employees/extraInfoView.vue'
import socialView from './components/views/employees/socialView.vue'
import trainingView from './components/views/employees/trainingView.vue'
import furtherEduView from './components/views/employees/furtherEduView.vue'
import professionTechView from './components/views/employees/professionTechView.vue'
import racesView from './components/views/employees/racesView.vue'
import projectView from './components/views/employees/projectView.vue'
import kpisView from './components/views/employees/kpisView.vue'
import Contact from './components/views/Contact.vue'
import TempUsers from './components/views/TempUsers.vue'
import RetriedUsers from './components/views/RetriedUsers.vue'
import Approvals from './components/views/Approvals.vue'
import Submits from './components/views/Submits.vue'
import SysConfig from './components/views/SysConfig.vue'

// Routes
const routes = [
  {
    path: '/login',
    component: LoginView
  },
  {
    path: '/',
    component: DashView,
    meta:{
      requireAuth: true,
      roleRequired:8
    },
    children: [
      {
        path: 'users',
        component: UsersView,
        name: '人事信息查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'dashboard',
        alias: '',
        component: DashboardView,
        name: '主页',
        meta: {requireAuth: true,roleRequired:8,description: ''}
      }, {
        path: 'userimport',
        component: UserImportView,
        name: '人事信息录入',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'organization',
        component: organizationView,
        name: '组织架构管理',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'onjobusers',
        component: OnJobUsers,
        name: '在职人员花名册（公开抓取信息）',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },,{
        path: 'tempusers',
        component: TempUsers,
        name: '临时人员花名册（公开抓取信息）',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },,{
        path: 'retriedusers',
        component: RetriedUsers,
        name: '退休人员花名册（公开抓取信息）',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'accountMgr',
        component: accountMgr,
        name: '账号角色管理',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'roleMgr',
        component: roleMgr,
        name: '角色管理',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'funcPrivMgr',
        component: funcPrivMgr,
        name: '功能授权管理',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'dataPrivMgr',
        component: dataPrivMgr,
        name: '数据授权管理',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'reportPrivMgr',
        component: reportPrivMgr,
        name: '报表授权管理',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'sysConfig',
        component: SysConfig,
        name: '基础配置',
        meta: {requireAuth: true,roleRequired:4,description: ''}
      },{
        path: 'baseInfoMgr',
        component: employeeBaseInfo,
        name: '基础信息查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'extraInfoMgr',
        component: extraInfoView,
        name: '补充信息查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'social',
        component: socialView,
        name: '家庭及主要社会关系查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'training',
        component: trainingView,
        name: '在职培训查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'furtherEdu',
        component: furtherEduView,
        name: '在职进修学历(学位)教育查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'professionTech',
        component: professionTechView,
        name: '专业技术职务查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'races',
        component: racesView,
        name: '参加活动(竞赛)情况查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'project',
        component: projectView,
        name: '参与工程项目建设情况查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'kpis',
        component: kpisView,
        name: '年度考核查询',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'contact',
        component: Contact,
        name: '通讯录',
        meta: {requireAuth: true,roleRequired:0,description: ''}
      },{
        path: 'approvals',
        component: Approvals,
        name: '流程审批管理',
        meta: {requireAuth: true,roleRequired:2,description: ''}
      },{
        path: 'submits',
        component: Submits,
        name: '我的流程申请',
        meta: {requireAuth: true,roleRequired:1,description: ''}
      }
    ]
  }, {
    // not found handler
    path: '*',
    component: NotFoundView
  }
]

export default routes
